var Questionnaire = {
    /**
     * This method is used for getting the info of the "Pages" included in a "Dialog".
     */
    getQuestionSetData : function () {
        var gatherQuestionSetsInfo = function () {
            var dataList = new Array();
            $("#questionSetList table").each(function() {
                var qData = {};
                qData.id = $(this).attr("qsId");
                qData.sequence = $(this).attr("sequence");
                dataList.push(qData);
            });

            return dataList;
        }
        var dataList = gatherQuestionSetsInfo();

        return JSON.stringify(dataList);
    },

    /**
     * The method is used for doing necessary works before submit the 'Create', 'Edit', 'New Version', 'Copy' form.
     * Works: Gather the info of the 'Questions' included in a 'Page'; Store the info of the 'Questions';
     */
    actionBeforeSubmit : function () {
        var seqJSON = this.getQuestionSetData();
        $("#questionSetsData").val(seqJSON);
        $("#questionSetsBak").val($("#questionSetList").html());
        $("#questionSetListMsgBak").val($("#questionSetListMessage").html());
    }
}